<?php get_header(); ?>
        <div id="primary">
            <div id="content" role="main">
                <div id="marcas" class="carousel">
                         <a href="javascript:void(0)" class="prev"><img src="<?=bloginfo('template_directory' );?>/images/marcas_prev.jpg" alt=""></a>
                    <ul>
<?                      $args = array(
                            'authors'      => '',
                            'child_of'     => 9,
                            'date_format'  => get_option('date_format'),
                            'depth'        => 0,
                            'echo'         => 1,
                            'exclude'      => '',
                            'include'      => '',
                            'link_after'   => '',
                            'link_before'  => '',
                            'post_type'    => 'page',
                            'post_status'  => 'publish',
                            'nopaging'     => true,
                            'show_date'    => '',
                            'sort_column'  => 'menu_order, post_title',
                            'title_li'     => __('Pages'), 
                            'walker'       => ''
                        );
                        query_posts($args);
 ?>
                        <?php while ( have_posts() ) : the_post(); ?>
<?php                       //$array = get_post_custom_values('imagem'); 
                            $imagem = get('imagem');
                            if ($imagem) { ?>
                                <li><a href="<?=the_permalink();?>"><img src="<?php echo $imagem;?>" /></a></li>
                            <?php } ?>
<?php                   endwhile; // end of the loop.
                        wp_reset_query(); ?>

                    </ul>
                    <a href="javascript:void(0)" class="next"><img src="<?=bloginfo('template_directory' );?>/images/marcas_next.jpg" alt=""></a>
                </div>
                <div class="clear"></div>
                <div id="lancamentos">
                    <p class="entry-title">LANÇAMENTOS</p>
                    <ul>
<?php               
                    $args = array(
                        'posts_per_page'  => 3,
                        'offset'          => 0,
                        'orderby'         => 'post_date',
                        'order'           => 'DESC',
                        'include'         => '',
                        'exclude'         => '',
                        'meta_key'        => '',
                        'meta_value'      => '',
                        'post_type'       => 'post',
                        'post_mime_type'  => '',
                        'post_parent'     => '',
                        'post_status'     => 'publish',
                        'suppress_filters' => true,
                        'meta_query'             => array(
                            array(
                                'key'       => 'destaque_home',
                                'value'     => 'Lançamento',
                                'compare'   => '=',
                            ),
                        ),
                    );
                    query_posts($args);
                    if ( have_posts() ) :
                        while ( have_posts() ) : the_post();
                    ?>
                    <?php
                            $imagem = get('imagens');
                            if (get("imagem_destaque")) {
                                $imagem = get('imagem_destaque');
                            }
                            
                            $title_lancamento = get_the_title();
                            if (get('texto_de_destaque')) {
                                $title_lancamento = get('texto_de_destaque');
                            }
                    ?>
                            <li>
                                <a href="<?=the_permalink();?>"><img src="<?php echo $imagem;?>" /></a>
                                <p class="nome"><?=$title_lancamento;?></p>
                            </li>
<?php
                        endwhile;
                    endif;
                    wp_reset_query();
?>
                    </ul>
                </div>
                <div id="novidades">
                    <p class="entry-title">NOVIDADES</p>
<?php               $args = array(
                    	'posts_per_page'  => 3,
                    	'offset'          => 0,
                    	'category_name'   => 'novidades',
                    	'orderby'         => 'post_date',
                    	'order'           => 'DESC',
                    	'include'         => '',
                    	'exclude'         => '',
                    	'meta_key'        => '',
                    	'meta_value'      => '',
                    	'post_type'       => 'post',
                    	'post_mime_type'  => '',
                    	'post_parent'     => '',
                    	'post_status'     => 'publish',
                    	'suppress_filters' => true
                    );
                    query_posts($args);
                    $i = 1;
                    if ( have_posts() ) :
        				while ( have_posts() ) : the_post();
                            if ($i==2) echo '<img src="'.get_bloginfo('template_url').'/images/separacao.png" />';
                            ?>
        				    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                                <div class="entry-content">
                                    <a href="<?php the_permalink() ?>" class="titulo"><?php the_title(); ?></a>
                                    <?php
                                    $my_excerpt = strip_tags(get_the_excerpt());
                                    echo $my_excerpt; // Outputs the processed value to the page
                                    ?>
                                    <a class="leia" href="<?php the_permalink() ?>">Leia [+]</a>
                                </div>
                            </article>
                        <?php
                            if ($i==2) echo '<img src="'.get_bloginfo('template_url').'/images/separacao.png" />';
                            $i++;
        				endwhile;
        			endif;
                    wp_reset_query();
?>              </div><!-- #novidades -->
                <div id="produtos">
                    <div class="block100">
                        <p class="entry-title fl">PRODUTOS</p>
                        <div class="fr">
                            <a href="<?php echo get_bloginfo('home')."/wp-content/uploads/2014/Catalogo_Produtos.pdf"; ?>" target="_blank"><img src="<?php bloginfo('template_url') ?>/images/bt_catalogo_online.jpg"></a>
                            <a href="<?php echo get_bloginfo('home')."/produtos/";?>"><img src="<?php bloginfo('template_url') ?>/images/bt_ver_todos.jpg"></a>
                        </div>
                    </div>
<?php               $args = array(
                        'posts_per_page'  => 2,
                        'offset'          => 0,
                        'category_name'   => 'produto',
                        'orderby'         => 'post_date',
                        'order'           => 'DESC',
                        'include'         => '',
                        'exclude'         => '',
                        'meta_key'        => '',
                        'meta_value'      => '',
                        'post_type'       => 'post',
                        'post_mime_type'  => '',
                        'post_parent'     => '',
                        'post_status'     => 'publish',
                        'suppress_filters' => true,
                        'meta_query'             => array(
                            array(
                                'key'       => 'destaque_home',
                                'value'     => 'Destaque',
                                'compare'   => '=',
                            ),
                        ),
                    );
                    query_posts($args);
                    if ( have_posts() ) :
                        $conta=1;
                        while ( have_posts() ) : the_post();
                            /*$array = get_post_custom_values('imagens'); 
                            $imagem = $array[0];*/
                            ?>
                            <a class="produto prod_destaque<?php echo $conta;?>" href="<?=the_permalink();?>">
                                <?php /*<img src="<?=get_bloginfo('wpurl');?>/wp-content/files_mf/<?=$imagem;?>" />*/?>
                                <?php echo get_image("imagem_destaque"); ?>
                                <div class="legenda"><?=the_title();?></div>
                            </a>
                            <?php
                            $conta++;
                        endwhile;
                    endif;
                    wp_reset_query();
?>
                    <!-- <div class="produto">
                        <div class="legenda"> PRODUTO 2</div>
                    </div> -->
                </div><!-- #produtos -->
                <div class="clear"></div>
                <div id="receita">
                    <a href="<?=get_bloginfo('wpurl');?>/category/receitas" class="entry-title">RECEITAS<!-- <img src="<?php bloginfo('template_url');?>/images/tudoGourmet.jpg" alt="Tudo Gourmet"> --></a>
                    <div class="clear"></div>
<?php               $args = array(
                        'posts_per_page'  => 1,
                        'offset'          => 0,
                        'category_name'   => 'receitas',
                        'orderby'         => 'post_date',
                        'order'           => 'DESC',
                        'include'         => '',
                        'exclude'         => '',
                        'meta_key'        => '',
                        'meta_value'      => '',
                        'post_type'       => 'post',
                        'post_mime_type'  => '',
                        'post_parent'     => '',
                        'post_status'     => 'publish',
                        'suppress_filters' => true
                    );
                    query_posts($args);
                    if ( have_posts() ) :
                        while ( have_posts() ) : the_post();
                            the_post_thumbnail(); ?>
                    <div class="infos">
                            <a class="entry-title"><? the_title();?></a>
                            <? the_excerpt();?>
                            <a class="leia-mais" href="<?=the_permalink();?>"><img class="receita_completa" src="<?php bloginfo('template_url');?>/images/receita_completa.jpg" alt=""></a>
                    </div>
<?                      endwhile;
                    endif;
?>              </div><!-- #receita -->
			</div><!-- #content -->
		</div><!-- #primary -->

<?php //get_sidebar(); ?>
	<div class="clear"></div>
	<!-- <section id="itens">
        <a class="tv-fiia" href="<?php echo bloginfo('url');?>/tv-fiia/"><img src="<?php //echo bloginfo('template_url');?>/images/tv_fiia.png" align="TV FIIA" /></a>
        <a class="mapa-do-evento" href="<?php echo bloginfo('url');?>/mapa-do-evento/"><img src="<?php //echo bloginfo('template_url');?>/images/mapa_do_evento.png" align="Mapa do Evento" /></a>
        <a class="programacao" href="<?php echo bloginfo('url');?>/programacao/"><img src="<?php //echo bloginfo('template_url');?>/images/programacao.png" align="Programação" /></a>
        <a class="imprensa" href="<?php echo bloginfo('url');?>/imprensa/"><img src="<?php //echo bloginfo('template_url');?>/images/imprensa.png" align="Imprensa" /></a>
    </section> -->
<?php get_footer(); ?>